﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SampleCardSearch.aspx.cs" Inherits="PPAP.Web.SearchReport.SampleCardSearch" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register TagPrefix="cc1" Namespace="PPAP.WebControls" Assembly="PPAP.WebControls" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="../Common/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script language="javascript">
        function add() {
            url = "PPAPTasksEdit.aspx";
            PopUpWindow(url, 400, 150, 580, 400);
        }
        function edit(id, sid) {
            url = "../todolist/SampleCardWeb.aspx?RID=" + id + "&SID=" + sid+"&his=1";
            window.location.href = url;
        }
    </script>
</head>
<body>
    <form id="Form1" runat="server">
    <div>
        <table width="800px" style="border-color: #2A48CE; border: 1px; border-style: solid;
            border-color: Gray; border-spacing: 0px;">
            <tr style="height: 32px;">
                <td style="font-weight: bold;" bgcolor="#D7D7D7" colspan="4">
                    Filter SET</td>
            </tr>
            <tr>
                <td>
                    Part No.:
                </td>
                <td>
                    <cc1:PartNo ID="txtPartNo" runat="server" Width="200px" />
                </td>
                <td>
                    Supplier Code:
                </td>
                <td>
                    <asp:TextBox ID="txtSupplierNo" runat="server" Width="200px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Create from:
                </td>
                <td>
                    <cc1:My97 ID="txtCreateStart" runat="server" Width="100px"></cc1:My97>
                    To:<cc1:My97 ID="txtCreateEnd" runat="server" Width="100px"></cc1:My97>
                </td>
                <td>
                    End 
                    time: 
                </td>
                <td>
                    <cc1:My97 ID="txtTimeStart" runat="server" Width="100px"></cc1:My97>
                    To:<cc1:My97 ID="txtTimeEnd" runat="server" Width="100px"></cc1:My97>
                </td>
            </tr>
            <tr>
                <td>
                    Department:
                </td>
                <td>
                    <asp:DropDownList ID="ddlDepartment" runat="server" Width="200px">
                    </asp:DropDownList>
                </td>
                <td>
                    Dept.rep:</td>
                <td>
                    <asp:DropDownList ID="ddlDept" runat="server" Width="200px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    Status: 
                </td>
                <td>
                    <asp:DropDownList ID="ddlStatus" runat="server" Width="200px">
                        <asp:ListItem>All</asp:ListItem>
                        <asp:ListItem Value="0">testing</asp:ListItem>
                        <asp:ListItem Value="1">Already test</asp:ListItem>
                        <asp:ListItem Value="2">Reject</asp:ListItem>
                        <asp:ListItem Value="3">Approve</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td>
                   Result:</td>
                <td>
                    <asp:DropDownList ID="ddlResult" runat="server" Width="200px">
                        <asp:ListItem>All</asp:ListItem>
                        <asp:ListItem Value="G">Green</asp:ListItem>
                        <asp:ListItem Value="R">Red</asp:ListItem>
                        <asp:ListItem Value="Y">Yellow</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td align="left" colspan="2">
                    <asp:CheckBox ID="cbCase" runat="server" Text="My case" />
                </td>
                <td align="center">
                    &nbsp;
                </td>
                <td align="right" style=" padding-right:30px;" >
                    <asp:Button ID="btnSubmit" CssClass="button" runat="server" Text="Search" OnClick="btnSubmit_Click" />
                &nbsp;
                    <asp:Button ID="btnExport" CssClass="button" runat="server" Text="Export" 
                        OnClick="btnExport_Click" />
                </td>
            </tr>
        </table>
        <br />
       <asp:DataGrid ID="dgList" HeaderStyle-BackColor="#2E8AC5" HeaderStyle-Font-Bold="true"
                    HeaderStyle-Height="32px" Width="100%" OnLoad="dgLoad" AutoGenerateColumns="False"
                    runat="server">
                    <Columns>
                        <asp:BoundColumn DataField="rownum" HeaderText="No.">
                            <ItemStyle HorizontalAlign="Left"></ItemStyle>
                        </asp:BoundColumn>
                        <asp:BoundColumn DataField="pparno" HeaderText="PPAR.No">
                            <ItemStyle HorizontalAlign="Left"></ItemStyle>
                        </asp:BoundColumn>
                        <asp:BoundColumn DataField="bdntpartno" HeaderText="Part.No">
                            <ItemStyle HorizontalAlign="Left"></ItemStyle>
                        </asp:BoundColumn>
                        <asp:BoundColumn DataField="suppliercode" HeaderText="Suppiler code">
                            <ItemStyle HorizontalAlign="Left"></ItemStyle>
                        </asp:BoundColumn>
                        <asp:TemplateColumn HeaderText="Sample card no.">
                            <ItemStyle HorizontalAlign="Left"></ItemStyle>
                            <ItemTemplate>
                                <asp:Label ID="Label10" runat="server" Text='<%#"SC-" + Eval("samplecardno")%>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateColumn>
                        <asp:TemplateColumn HeaderText="Department">
                            <ItemStyle HorizontalAlign="Left"></ItemStyle>
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%#Eval("testitemname") %>'></asp:Label>
                             </ItemTemplate>
                        </asp:TemplateColumn>
                        <asp:TemplateColumn HeaderText="Dept.rep">
                            <ItemStyle HorizontalAlign="Left"></ItemStyle>
                            <ItemTemplate>
                                <asp:Label ID="Label9" runat="server" Text='<%#Eval("DEPTREP") %>'></asp:Label>
                             </ItemTemplate>
                        </asp:TemplateColumn>
                        <asp:TemplateColumn HeaderText="Status">
                            <ItemStyle HorizontalAlign="Left"></ItemStyle>
                            <ItemTemplate>
                                <asp:Label ID="Label5" runat="server" Text='<%#Status(Eval("STATUS").ToString()) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateColumn>
                        <asp:TemplateColumn HeaderText="Result">
                            <ItemStyle HorizontalAlign="Left"></ItemStyle>
                            <ItemTemplate>
                                <asp:Image ID="Image1" Visible='<%#Eval("RESULT").ToString()==""?false:true %>' ImageUrl='<%#"~/Part/image/"+Eval("RESULT")+".png" %>' runat="server" />
                            </ItemTemplate>
                        </asp:TemplateColumn>
                        <asp:TemplateColumn HeaderText="Start time">
                            <ItemStyle HorizontalAlign="Left"></ItemStyle>
                            <ItemTemplate>
                                <asp:Label ID="Label7" runat="server" Text='<%#Eval("starttime").ToString()==""?"":DateTime.Parse(Eval("starttime").ToString()).ToString("yyyy-MM-dd")  %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateColumn>
                        <asp:TemplateColumn HeaderText="End time（planned）">
                            <ItemStyle HorizontalAlign="Left"></ItemStyle>
                            <ItemTemplate>
                                <asp:Label ID="Label8" runat="server" Text='<%#Eval("endtimeplan").ToString()==""?"":DateTime.Parse(Eval("endtimeplan").ToString()).ToString("yyyy-MM-dd")  %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateColumn>
                         <asp:TemplateColumn HeaderText="View" HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left" >
                        <ItemTemplate>
                        <img src="../Images/newimg/write.png" title="View" onclick="<%#"javascript:edit("+Eval("rid")+","+Eval("ID")+");" %>" />
                        </ItemTemplate>
                        </asp:TemplateColumn>
                    </Columns>
                    <HeaderStyle BackColor="#E7E8E8" Font-Bold="True" Height="32px"></HeaderStyle>
                </asp:DataGrid>
        <webdiyer:AspNetPager ID="AspNetPager2"  runat="server" Width="100%" CssClass="paginator"
                                ShowPageIndexBox="Always" 
            PageIndexBoxType="DropDownList" TextBeforePageIndexBox="goto"
                                HorizontalAlign="Center" PageSize="20" EnableTheming="true" 
                        AlwaysShow="True" FirstPageText="|&lt;"
                                LastPageText="&gt;|" NextPageText="&gt;" 
                        PrevPageText="&lt;" SubmitButtonText="Go"
                                TextAfterPageIndexBox="page" 
                        InvalidPageIndexErrorMessage="Page index is not effective numerical！" 
                        onpagechanged="AspNetPager2_PageChanged" 
                        PageIndexOutOfRangeErrorMessage="Page index beyond range" 
            BackColor="#E7E8E8" >
                            </webdiyer:AspNetPager>
    </div>
    </form>
</body>
</html>
